#!/usr/bin/env python
#-*- coding:utf-8 -*-

import logging
from shorp.core.interpreter import *
from shorp.shorp import Shorp

VERSION = '20100318'
logger = logging.getLogger('shorp.htmlinterpreter')

class HtmlInterpreter(Interpreter):
    def __init__(self, rule):
        shorp = Shorp()
        shorp.add(rule)
        self.rule = shorp.run()
        print self.rule
        
    def interpret(self, node, intent=0):
        html = ""
        childs = node.getChilds()
        
        for child in childs:
            html += self.interpret(child)
        
        return html
        